From: Lars Magne Ingebrigtsen Date: Mon, 18 Oct 2010 20:32:54 +0000 (+0200) Subject: (emacs_gnutls_read): Return 0 if we get a non-"EAGAIN"-like error to signal to Emacs... X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~6055 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=014d6131e6c19b13921c7e5825ce0a5e3a88cc3e;p=emacs.git (emacs_gnutls_read): Return 0 if we get a non-"EAGAIN"-like error to signal to Emacs that the socket should be closed. --- diff --git a/src/ChangeLog b/src/ChangeLog index da344a41c53..4f49ee8b378 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-10-18 Lars Magne Ingebrigtsen + + * gnutls.c (emacs_gnutls_read): Return 0 if we get a + non-"EAGAIN"-like error to signal to Emacs that the socket should + be closed. + 2010-10-15 Eli Zaretskii * unexcoff.c (make_hdr): Fix prototype according to changes in diff --git a/src/gnutls.c b/src/gnutls.c index 577cca247ee..1cc258a5096 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -125,8 +125,13 @@ emacs_gnutls_read (int fildes, struct Lisp_Process *proc, char *buf, rtnval = gnutls_read (state, buf, nbyte); if (rtnval >= 0) return rtnval; - else - return -1; + else { + if (rtnval == GNUTLS_E_AGAIN || + rtnval == GNUTLS_E_INTERRUPTED) + return -1; + else + return 0; + } } /* convert an integer error to a Lisp_Object; it will be either a